package c.j.a.c.y.a;

import android.graphics.PointF;
import android.view.animation.Interpolator;
import com.huawei.hms.analytics.core.crypto.AesCipher.AesLen;

/* compiled from: CubicBezierInterpolator */
public class h implements Interpolator {
    public int a = 0;
    public final PointF b;
    public final PointF c;

    public h(float f, float f2, float f3, float f4) {
        PointF pointF = new PointF();
        this.b = pointF;
        PointF pointF2 = new PointF();
        this.c = pointF2;
        pointF.x = f;
        pointF.y = f2;
        pointF2.x = f3;
        pointF2.y = f4;
    }

    public static double a(double d, double d2, double d3) {
        double d4 = 1.0d - d;
        double d5 = d * d;
        return ((((d4 * 3.0d) * d5) * d3) + ((((d4 * d4) * 3.0d) * d) * d2)) + (d5 * d);
    }

    public float getInterpolation(float f) {
        if (f == 0.0f) {
            this.a = 0;
        }
        float f2 = f;
        for (int i = this.a; i < AesLen.ROOTKEY_COMPONET_LEN; i++) {
            f2 = ((float) i) * 0.0078125f;
            if (a((double) f2, (double) this.b.x, (double) this.c.x) >= ((double) f)) {
                this.a = i;
                break;
            }
        }
        double a = a((double) f2, (double) this.b.y, (double) this.c.y);
        if (f == 1.0f) {
            this.a = 0;
        }
        return (float) a;
    }
}
